<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class AddIdxAccessTokenInOauthTokenInTable extends AbstractMigration
{
    public function up()
    {
        $this->table("oauth_token")
            ->addIndex(["access_token"], [
                'type' => 'unique',
                'name' => 'idx_oauth_token'
            ])
            ->save();
    }

    public function down()
    {
        $this->table("oauth_token")
            ->removeIndexByName("idx_oauth_token")
            ->save();
    }
}
